<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{$webSiteInfo.site_name}</title>
<link href="{:CSS}bootstrap.min.css" rel="stylesheet" />
<link href="{:CSS}font-awesome.css" rel="stylesheet" />
<link href="{:CSS}admin.min.css" rel="stylesheet" />
<script src="{:JQ}"></script>
<script src="{:JS}bootstrap.min.js"></script>
<script src="{:JS}common.min.js"></script>
<script src="{:JS}admin.min.js"></script>
</head>
<body>
<div id="wrapper">
    <nav class="navbar navbar-default top-navbar" role="navigation">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{:U('Admin/Index/index')}">网站管理平台</a>
        </div>
        <ul class="nav navbar-top-links navbar-right">
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                    <i class="fa fa-user fa-fw"></i> {$Think.session.adminInfo.name} <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-user">
                    <li><a href="{:U('Public/editPwd')}"><i class="fa fa-gear fa-fw"></i> 修改密码</a></li>
                    <li class="divider"></li>
                    <li><a href="{:U('Public/logout')}"><i class="fa fa-sign-out fa-fw"></i> 退出登录</a></li>
                </ul>
            </li>
        </ul>
    </nav>
    <nav class="navbar-default navbar-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav" id="main-menu">
                <li><a href="{:U('Index/index')}"> 后台首页</a></li>
                <volist name="menuList" id="menuList">
                    <empty name='menuList.sub'>
                        <li><a href="{:U($menuList['name'])}"> {$menuList.title}</a></li>
                    <else/>
                        <li><a href="#"> {$menuList.title}<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <volist name="menuList.sub" id="sub">
                                    <li><a href="{:U($sub['name'])}" class="menu_{:str_replace('/', '_', $sub['name'])} menu_{:substr($sub['name'], 0, strpos($sub['name'], '/'))}"> {$sub.title}</a></li>
                                </volist>
                            </ul>
                        </li>
                    </empty>
                </volist>
            </ul>
        </div>
    </nav>
    <div id="page-wrapper">
		<div id="page-inner">
	        {__CONTENT__}
		</div>
	</div>
</div>
<script type="text/javascript">
    var obj = $('.menu_{:CONTROLLER_NAME}_{:ACTION_NAME}');
    if(obj.length > 0){
    	obj.parent().removeClass('active').parents('li').addClass('active');
    }else{
    	$('.menu_{:CONTROLLER_NAME}').parent().removeClass('active').parents('li').addClass('active');
    }
</script>
</body>
</html>